from cocos import director
import config
from GameStartPage import GameStartScene
from GamePlayPage import GamePlayScene
from events import fj_event_dispatcher

'''
说明：本文件是主程序入口
功能：
1. 定义界面大小
2. 运行进入场景（GameStartPage）
'''


def on_game_start():
    director.director.replace(GamePlayScene())

# fj_event_dispatcher.push_handlers(on_game_restart)
fj_event_dispatcher.push_handlers(on_game_start)


def main():
    '''
    功能：调用主页面
    输入值：无
    :return: 无返回值
    '''
    director.director.init(caption="ETIME Flight",
                           width=config.WIN_WIDTH,
                           height=config.WIN_HEIGHT)
    director.director.run(GameStartScene())


if __name__ == '__main__':
    main()
